/*
 * navinode.hpp
 *
 *  Created on: 30/11/2011
 *      Author: Aeradon
 */

#ifndef NAVINODE_HPP_
#define NAVINODE_HPP_

#include "triangulation.hpp"
#include "../include/point.hpp"
#include "PFRUtils.hpp"

class Face;

//#ifdef _BUILD_DLL
//   #define DLLDIR  __declspec(dllexport)   // export DLL information
//#else
//   #define DLLDIR  __declspec(dllimport)   // import DLL information
//#endif
//
//class DLLDIR NaviNode
class NaviNode
{
private:/// DEFINITIONS and STATICS
	typedef float	   T;

public: // Methods
	NaviNode(Face *face);

	virtual ~NaviNode();

	T X();
	T Y();
	Point<T> Pos();

	inline Face* fac()	{ return face; }

	bool IsMarked();
	void ResetMark();
	void Mark();

private: // Atributes
	// pointer to the triangle face represented by this node
	Face *face;

	// x and y used in center distance calculation
	T x,y;

	unsigned int mark;
	static unsigned int markCount;

public: // Atributes
	// values f, g and h used in the A* algorithm
	T f, g, h;

	// the 3 pointers to the 3 next triangles from this one
	NaviNode *n[3];
	// pointer to the triangle father
	NaviNode *p;

	// number of this element in the nodes vector
	unsigned int vecIndex;
	// number of open childs in this node
	unsigned int n_open;
};

#endif /* NAVINODE_HPP_ */
